﻿/**************************************************************
 * Description:
 * CreateAPBilListUIModelAction.cs
 * Product: U9
 * Co.    : UFSoft Group
 * Author : Auto Generated 
 * version: 1.0
 **************************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UFIDA.UBF.Query.CaseModel;
using UFIDA.UBF.Query.CommonService;
using UFIDA.UBF.Query.CommonService.QueryStrategy;
using UFSoft.UBF.AopFrame.Lock;
using UFSoft.UBF.Report.Filter.FilterModel;
using UFSoft.UBF.UI.ActionProcess;
using UFSoft.UBF.UI.ControlModel;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.Util.Log;




namespace UFIDA.U9.Cust.HWProject.CreateAPBillHead.CreateAPBilListUIModel
{
	public partial class CreateAPBilListUIModelAction 
	{
		public override void OnInitAction()
		{
			base.OnInitAction();
			//提示:可注册你自己的方法到相应的事件中,如下.
			//this.CommonAction.BeforeLoad += new ActionLoadDelegate(CommonAction_BeforeLoad);
		}
		private void OnSelect_Extend(object sender, UIActionEventArgs e)
		{
	
			

			//调用模版定义的默认实现方法.如需扩展,请直接在此编程.			
this.OnSelect_DefaultImpl(sender,e);								
        } 
		private void OnToSRM_Extend(object sender, UIActionEventArgs e)
		{
            using (new BPForEngine())
            {
                UFIDA.U9.Cust.HWProject.CreateAPBillHead.CreateAPBilBP.CreateAPBil createAPBilBP = new CreateAPBillHead.CreateAPBilBP.CreateAPBil();
                createAPBilBP.Do();
            }
            
			//调用模版定义的默认实现方法.如需扩展,请直接在此编程.			
this.OnToSRM_DefaultImpl(sender,e);								
        } 
		private void OnDoubleSelect_Extend(object sender, UIActionEventArgs e)
		{
	
			

			//调用模版定义的默认实现方法.如需扩展,请直接在此编程.			
this.OnDoubleSelect_DefaultImpl(sender,e);								
        } 
		
		#region UBF 内置两数据处理Action
		//数据加载的扩展
		private void OnLoadData_Extend(object sender, UIActionEventArgs e)
		{
this.OnLoadData_DefaultImpl(sender,e);			
		}

		//数据收集的扩展
		private void OnDataCollect_Extend(object sender, UIActionEventArgs e)
		{
			this.OnDataCollect_DefaultImpl(sender,e);
		}

        //public void InitCurrentViewCaseModel()
        //{
        //    QryService.ClearSession((UFSoft.UBF.UI.FormProcess.BaseWebForm)(this.CurrentPart));

        //    IUFDataGrid UIGrid = this.CurrentPart.GetUFControlByName(this.CurrentPart.TopLevelContainer, "DataGrid") as IUFDataGrid;

        //    //使用DTO查询策略

        //    DTOQueryStrategyImpl dtoQryStrategyImpl = new DTOQueryStrategyImpl(this.CurrentState, DTOFullName, QryModelID, this.MainView, UIGrid);

        //    UBF.Query.CaseModel.CaseModel  caseModel = dtoQryStrategyImpl.GetQryModel();
        //    caseModel.PageSizeEnable = false;
        //    caseModel.ColumnTabIsVisible = false;
        //    caseModel.SortTabIsVisible = false;

        //    // FilterBuilder.GetInstance(caseModel.Case.FilterValues, caseModel.Case.FilterDefines)("ItemCode")

        //    FilterBuilder fb = FilterBuilder.GetInstance(caseModel.Case.FilterValues, caseModel.Case.FilterDefines);
        //    //caseModel.CaseDefine.FilterDefines[0].ContextValueList.Add()
        //    for (int i = 0; i < caseModel.CaseDefine.FilterDefines.Count; i++)
        //    {
        //        caseModel.CaseDefine.FilterDefines[i].AllowBlank = true;
        //        caseModel.CaseDefine.FilterDefines[i].OperatorList = new System.Collections.Generic.List<UFSoft.UBF.Report.Filter.enuOperatorListType>();
        //        caseModel.CaseDefine.FilterDefines[i].OperatorList.Clear();
        //        caseModel.CaseDefine.FilterDefines[i].OperatorList.Add(UFSoft.UBF.Report.Filter.enuOperatorListType.Equal);
        //        caseModel.CaseDefine.FilterDefines[i].OperatorList.Add(UFSoft.UBF.Report.Filter.enuOperatorListType.In);
        //    }
        //    QryService.SetCaseModelToSession((UFSoft.UBF.UI.FormProcess.BaseWebForm)(this.CurrentPart), caseModel);
        //}

        public bool IsCheckDateCount(UBF.Query.CaseModel.CaseModel caseModel)
        {
            string Error = string.Empty;
            if (string.IsNullOrEmpty(Error))
            {
                return true;
            }
            else
            {
                throw new Exception(Error);
            }

        }

        public string QryModelID = "19d9004b-5919-43d4-abb6-920a79708043";

        public string DTOFullName = "UFIDA.U9.Cust.HWProject.CreateAPBillHead.GetCustAPBilListBP.APBilMonitorDTO";//定义DTO实体全名
        #endregion


    }
}
